package user;

import book.BookList;
import operation.*;
import org.omg.IOP.IOR;

import java.util.Scanner;

//用户
public class User extends Person {
    @Override
    public int menu() {
        System.out.println("**************************************************");
        System.out.println("*********     图书管理系统-访客菜单         **********");
        System.out.println("*********    1.查找图书      2.借阅图书    **********");
        System.out.println("*********    3.归还图书      4.显示图书    **********");
        System.out.println("*********    0.退出系统                   **********");
        System.out.println("**************************************************");
        Scanner scanner = new Scanner(System.in);
        System.out.print("请选择你的操作：");
        int choise = scanner.nextInt();
        return choise;
    }

    @Override
    public void caouo(int choise, BookList booklist) {
        super.iOperation[choise].work(booklist);
    }

    @Override
    public void huanying() {
        System.out.println("你好，访客 "+name+" !!!");
    }

    public User(String name) {
        super(name);
        super.iOperation = new IOperation[]{new exit(),new find(),new lend(),new back(),new show()};
    }
}